﻿using System;

class Person
{
    public string Name { get; set; }
    public int Age { get; set; }

    //构造函数
    public Person()
    {
        Name = "Default Name";
        Age = 0;
    }

    public Person(string name, int age)
    {
        Name = name;
        Age = age;
    }

    
    public override string ToString()
    {
        return $"Name: {Name}, Age: {Age}";
    }
}

class Program
{
    static void Main(string[] args)
    {
      
        Type personType = typeof(Person);

        object person1 = Activator.CreateInstance(personType); // 反射默认构造函数
        Console.WriteLine(person1);

        
        
        object person2 = Activator.CreateInstance(personType, "A", 1); // 传入参数
        Console.WriteLine(person2);

       
    }
}

